package com.harmontronics.hanma.paas.paas.dto.input;

import com.harmontronics.hanma.paas.paas.consts.EnvEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * 数据源环境配置
 *
 * @author paas-generator
 * @email paas-generator@harmontronics.com
 * @date 2021-05-12 11:12:41
 */
@Data
public class HmDatasourceEnvCreateInput {


    @ApiModelProperty(value = "环境")
    @NotNull(message = "hm.pass.field_non_nullable")
    private EnvEnum env;


    /**
     * 主机
     */
    @ApiModelProperty(value = "主机")
    @NotNull(message = "hm.pass.field_non_nullable")
    @NotEmpty(message = "hm.pass.field_non_nullable")
    @NotBlank(message = "hm.pass.field_non_nullable")
    private String host;

    /**
     * 端口
     */
    @ApiModelProperty(value = "端口")
    @NotNull(message = "hm.pass.field_non_nullable")
    private Integer port;

    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名")
    @NotNull(message = "hm.pass.field_non_nullable")
    @NotEmpty(message = "hm.pass.field_non_nullable")
    @NotBlank(message = "hm.pass.field_non_nullable")
    private String username;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码")
    private String password;


    /**
     * 数据库名称
     */
    @NotNull(message = "hm.pass.field_non_nullable")
    @NotEmpty(message = "hm.pass.field_non_nullable")
    @NotBlank(message = "hm.pass.field_non_nullable")
    private String databaseName;


}
